import { MessageBox } from "element-ui";

/**
 * 公共确认框
 *
 * @export
 * @param {string} [content='确认操作'] 弹框提示文字
 * @param {string} [title='提示'] 弹框标题
 * @param {string} [confirmButtonName='确认'] 确认按钮文字
 * @param {string} [cancelButtonName='取消'] 取消按钮文字
 * @param {boolean} [distinguishCancelAndClose=false] 关系和取消是否执行同一方法
 * @returns
 */
export function confirm(content = '确认操作', title = '提示', confirmButtonName = '确认', cancelButtonName = '取消', distinguishCancelAndClose = false) {
    return MessageBox.confirm(content, title, {
        confirmButtonText: confirmButtonName,
        cancelButtonText: cancelButtonName,
        distinguishCancelAndClose: distinguishCancelAndClose,
        closeOnClickModal: false,
        type: 'warning',
    })
}